/*
 * @Author: Njpyy
 * @Date: 2024-03-17 19:44:34
 * @LastEditors: Njpyy
 * @LastEditTime: 2024-03-17 20:00:11
 * @FilePath: /big-event/src/store/userInfo.js
 * @Description: 
 */

import { defineStore } from "pinia";
import { ref } from "vue";

export const useUserInfoStore = defineStore('userInfo', () => {
    //定义用户信息
    const info = ref({})

    //set方法
    const setInfo = (newInfo) => {
        info.value = newInfo
    }

    //remove方法
    const removeInfo = () => {
        info.value = {}
    }

    return {
        info,
        setInfo,
        removeInfo
    }
},
    {
        persist: true //持久化存储
    }
)